/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package org.merak.core.web.mvc;

import javax.servlet.http.HttpSession;

import org.merak.core.web.HttpRequest;
import org.merak.core.web.HttpResponse;

public interface IBusinessLogic {

    //~ Methods //////////////////////////////////////////////////////////////////
	//****************************************************************************
	/** Check if the logic is authorized to the current session/account */
	public boolean authorize(HttpSession session);

	//****************************************************************************
	/** Executes the business logic.
	 * The default return is a URI resolving to a view like "/WEB-INF/pages/home.jsp".
	 * But you can also redirect to some URL with a string like "redirect:MyUrl".
	 * Finally, to indicate no view, just return null. */
	public String execute(HttpRequest req,HttpResponse res) throws Exception;

	//****************************************************************************

}
